<?php


namespace app\common\gateway\data;

class JsonData implements Data
{
    protected $data = [];

    public function __construct($event, $data = [])
    {
        $this->data = [
            'event' => $event,
            'data' => $data
        ];
    }

    public function setData($data) {
        $this->data['data'] = $data;
        return $this;
    }

    public function getData()
    {
        return json_encode($this->data, JSON_UNESCAPED_UNICODE);
    }
}
